package com.zr.daoimpl;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.zr.dao.UpdateMyInfoDao;
import com.zr.model.Cuser;

@Repository("updateMyInfoDao")
public class UpdateMyInfoDaoImpl<T> extends BaseDaoImpl<T> implements UpdateMyInfoDao<T>{

	@Override
	public void updateMyInfoByInfo(int uid, String utel, String upassword) {
		int n =0;
	    List<Cuser> us = new ArrayList<Cuser>();
		String hql = "from Cuser where uid=:uid";
		Query que = this.getCurrentSession().createQuery(hql);
		que.setInteger("uid", uid);
		us = que.list();
		Cuser u = us.get(0);
		u.setUtel(utel);
		u.setUpassword(upassword);
		this.getCurrentSession().save(u);
	}

}
